
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href=".jpg" type="image/x-icon" />
  <title>.org</title>
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <link type="text/css" rel="stylesheet" media="all" href="css/tempcolors.css" />
</head><body>

<script type="text/javascript">//<![CDATA[
/**
*
*  AJAX IFRAME METHOD (AIM)
*  http://www.webtoolkit.info/
*
**/

AIM = {
	frame : function(c) {
		var n = 'f' + Math.floor(Math.random() * 99999);
		var d = document.createElement('DIV');
		d.innerHTML = '';
		document.body.appendChild(d);

		var i = document.getElementById(n);
		if (c && typeof(c.onComplete) == 'function') {
			i.onComplete = c.onComplete;
		}

		return n;
	},

	form : function(f, name) {
		f.setAttribute('target', name);
	},

	submit : function(f, c) {
		AIM.form(f, AIM.frame(c));
		if (c && typeof(c.onStart) == 'function') {
			return c.onStart();
		} else {
			return true;
		}
	},

	loaded : function(id) {
		var i = document.getElementById(id);
		if (i.contentDocument) {
			var d = i.contentDocument;
		} else if (i.contentWindow) {
			var d = i.contentWindow.document;
		} else {
			var d = window.frames[id].document;
		}
		if (d.location.href == "about:blank") {
			return;
		}

		if (typeof(i.onComplete) == 'function') {
			i.onComplete(d.body.innerHTML);
		}
	}

}

//]]></script>
Source code for index.php
<?php
//<script type="text/javascript"><!--mce:1--></script>??????????
/*
[attr]
Select based on a specific attribute, regardless of what tag it is associated with. All of the following forms that specify the attribute in different ways can be used with or without a tag name prefixing them, just like regular and generic class selectors.
tagname[attr]
Select based on a specific attribute for a specific element type.
[attr="value"]
Select based on a specific attribute that has a specific value assigned to it. To the best of my knowledge, the quotes are optional.
[attr~="value"]
Select based on a specific attribute that has a space separated list of values assigned to it, of which one exactly matches the values specified.
[attr|="value"]
Select based on a specific attribute that has a specific value assigned to it. This value is the value specified in the style rule followed by a dash and then any other information assigned to that attribute. This rule really only exists for indentifying language types, which take the form of "langcode-langsubcode", for instance, "en-US". Simply looking for [lang="en"] would not match on this, so the required selector becomes [lang|="en"].
 */

$csscolor='
body{ background-color:#2f4860; color:#606760; }
h1{ background-color:#2f4860; color:#ffffff; }
h2{ color:#2f4860; }
#perm-links a{ background-color:#2f4860; color:#ffffff; }
#perm-links a:hover{ color:#ffcc00; }
#inside{ background-color:#c0c0b0; }
#main-menu{ background-color:#c0c0b0; color:#af8060; }
#main-menu a{ background-color:#c0c0b0; color:#2f4860; }
#main-menu a:hover{ background-color:#ffffff; color:#2f4860; }
#main-menu h3{ color:#ffffff; }
#content{ background-color:#ffffff; }
#content a{ color:#2f4860; }
#content a:hover{ color:#2f4860; }
#content th { background-color:#cccccc; }
#content h3{ color:#2f4860; }
#content dt{ color:#2f4860; }
#footer{ background-color:#2f4860; color:#ffffff; }
.info-title{ background-color:#c0c0b0; color:#ffffff; }
';

$csslayout='
body{ margin:0; padding:0; font:normal 83% "helvetica" }
p{ text-align:justify; }
h1{ padding:5px; margin:0; text-align:right; border-bottom:solid 2px #ffffff; font-weight:bold; letter-spacing:-1px; }
h2{ margin:5px; margin-left:0; font-weight:normal; letter-spacing:-1px; }
#perm-links{ position:absolute; float:right; text-align:center; }
#perm-links a{ text-align:center; border:solid 1px #2f4860; font-weight:bold; text-decoration:none; }
#perm-links a:hover{ border:solid 1px #ffcc00; }
#main-menu{ border:solid 1px #c0c0b0; }
#main-menu{ width:19%; float:left; margin-bottom:25px; padding:3px; padding-bottom:60px;}
#perm-links ul{ list-style:none; }
#main-menu ul{ width:92%; margin:0; padding-left:19px; list-style:square; }
#main-menu li{ margin-bottom:2px; border-bottom:solid 1px #606070; }
#main-menu a{ width:96%; display:block; margin:0; padding: 1px; border:solid 1px #c0c0b0; font-weight:bold; text-decoration:none; text-align:left; }
#main-menu h3{ width:110%; margin:0; width:110%; margin:0; text-align:left; border-bottom:solid 1px #606070; letter-spacing:-1px; }
#content{ margin-left:22%; padding-left:8px; padding-right:8px; padding-bottom:10px;}
#content a{ font-weight:bold; text-decoration:none; }
#content a:hover{ text-decoration:underline; }
#content table{ margin:auto; margin-top:15px; margin-bottom:15px; width:550px; border:solid 1px #666666; }
#content td{ padding:3px; border:solid 1px #cccccc; }
#content h3{ margin:0; letter-spacing:-1px; border-bottom:solid 1px #2f4860; }
#content img{ margin:auto; margin-top:15px; margin-bottom:15px; border:solid 1px #666666; }
#content dt{ margin-top:8px; padding-left:10px; font-weight:bold; letter-spacing:-1px; }
#content dd{ width:90%; }
#footer{ clear:both; padding: 2px; border:solid 1px #2f4860; text-align:right; }
h5{ margin:0; text-align:right; }
.info-title{ margin:0; padding:2px; padding-left:5px; }
';

pfile('../../css/color.css',$csscolor);
pfile('../../css/layout.css',$csslayout);
$hisite=$_GET['site'];
header("Location:../../index2.php?site=$hisite&plugin=styled&page=");

function pfile($filename,$data,$limit=''){
  $handle=fopen($filename,'w');
  if(is_array($data)){ fwrite($handle,implode($limit,$data)); }
  else{ fwrite($handle,$data); }
  fclose($handle);
  return $filename;
}
?>



<div><?php /*page-break-before:always;*/ if(isset($_FILES['source'])){ echo"loaded";} ?>
<img class="colorpicker"/>
<div class="slider">slider</div>
<div class="toggle">toggle</div>
</div>
<select name="roottype"><option>type of root element</option>    <optgroup label="opt group?" ></optgroup>     </select>


<script type="text/javascript">//<![CDATA[
<?php $r=100;$b=100;$g=100; //echo $r << 16 | $g << 8 | $b; ?>

//include'widgets/numeric.php';
/*var allHTMLTags=new Array();
allHTMLTags=document.getElementsByTagName("*");*/

/*
   $binarydata32 = pack('H*','00000000');
   $float32 = unpack("f", $binarydata32); // 0.0
   $binarydata64 = pack('H*','0000000000000000');
   $float64 = unpack("d", $binarydata64); // 0.0
 */

//var rgb=function(r,g,b){ return r << 16 | g << 8 | b; }
//var bgr=function(r,g,b){ return Math.abs(r-255) << 16 | Math.abs(g-255) << 8 | Math.abs(b-255); }
//var bgr=function(c){ return '#'+(0xFFFFFF-eval('0x'+c.toString(16).substr(1))).toString(16); //0xFFFFFF - 0xFF4466 = 0xBB99

/*var copycssrule=function(){
    var r=100;
    var g=100;
    var b=100;
    var c=r << 16 | g << 8 | b;
    alert('<style type=\"text/css\">'+document.styledform.styled.value+'</style>'+c+'\
gfgfg:'+bgr(100,100,100));
  }*/


/*sitefucker*/
var sparams=new Array(),sclasses=new Array(), sels=new Array();
sclasses=['#sg','#styled'];

var els=new Array(); els=document.getElementsByTagName("*");
var el,elname;

var chk=new Array(),chki=0,chks=new Array();

var i,j,ic=els.length;
for(i=0,j=0;i<ic;++i){
  el=els[i];
  elname=el.className;
  switch(elname){
  case'chk':
    chk=el.innerHTML.split(':');
    chks[chki]=el.innerHTML;
    el.innerHTML=chk[0]+'<input type="checkbox"/>';
    ++chki;
    break;
  default: break;
  }
  sclasses[i]=elname;
}
alert('chk:'+chks[0]);


function styledsliders(){
  for(var i=0; i<allHTMLTags.length; ++i){
    if(allHTMLTags[i].className=="slider"){
      //allHTMLTags[i].style.display='none';
	  el.style.backgroundColor='red';
          el.innerHTML='<div onclick="this.style.position=\'absolute\';">yep a slider in css</div>';
    }
    //else{alert(i);}
  }
}

styledfont("marqueeshell",'italic small-caps bold 12mm "Courier New"');
styledmenus();
//styledbuttons();
function styledbuttons(){
  for(var i=0; i<allHTMLTags.length; ++i){
    if(allHTMLTags[i].className=="toggle"){
      //allHTMLTags[i].style.display='none';
	  var el=allHTMLTags[i];
	  var ed=el.innerHTML.split(";");
	  el.innerHTML="";
	  el.style.backgroundColor='red';
	  el.style.margin='0px';
	  el.style.padding='0px';
	  el.style.position="fixed";
	  el.style.height='1em';
	  el.style.font='italic small-caps bold 12mm "Courier New"'
	  //alert(ed[0]);
	  //var adiv=document.createElement('div');
	  //adiv.appendChild(document.createTextNode());
	  //el.appendChild(adiv);
	  el.innerHTML=el.id+"<br />"+ed.join("<br />");
    }
    //else{alert(i);}
  }
}

function styledmenus(){
  for(var i=0; i<allHTMLTags.length; ++i){
    if(allHTMLTags[i].className=="vmenu"){
      //allHTMLTags[i].style.display='none';
	  var el=allHTMLTags[i];
	  var ed=el.innerHTML.split(";");
	  el.innerHTML="";
	  el.style.backgroundColor='red';
	  el.style.margin='0px';
	  el.style.padding='0px';
	  el.style.position="fixed";
	  el.style.height='1em';
	  el.style.font='italic small-caps bold 12mm "Courier New"'
	  //alert(ed[0]);
	  //var adiv=document.createElement('div');
	  //adiv.appendChild(document.createTextNode());
	  //el.appendChild(adiv);
	  el.innerHTML=el.id+"<br />"+ed.join("<br />");
    }
    //else{alert(i);}
  }
}

function styledthings(){
  for(var i=0; i<allHTMLTags.length; ++i){
    if(allHTMLTags[i].className=="button"){
      //allHTMLTags[i].style.display='none';
	  var el=allHTMLTags[i];
	  el.style.backgroundColor='red';
	  el.style.margin='0';
	  el.style.padding='0';
	  var ed=el.innerHTML.split(";");
	  alert(ed[0]);
	  var adiv=document.createElement('div');
	  adiv.style.backgroundColor='green';
	  adiv.appendChild(document.createTextNode('hello'));
	  el.appendChild(adiv);
	  //el.innerHTML="<div>"+ed[0]+"</div>";
    }
    //else{alert(i);}
  }
}

function styledfont(cssclass,font){
  allHTMLTags=document.getElementsByTagName("*");
  for(var i=0; i<allHTMLTags.length; ++i){
    if(allHTMLTags[i].className==cssclass){
      //allHTMLTags[i].style.display='none';
	  allHTMLTags[i].style.font=font;
    }
    //else{alert(i);}
  }
}
//]]></script>

<script type="text/javascript">//<![CDATA[
templatecolors= new Array();
templatecolors['body;background-color']='#2f4860';
templatecolors['body;color']='#606760';
templatecolors['h1;background-color']='#2f4860';
templatecolors['h1;color']='#ffffff';
templatecolors['h2;color']='#2f4860';
templatecolors['#perm-links a;background-color']='#2f4860';
templatecolors['#perm-links a;color']='#ffffff';
templatecolors['#perm-links a:hover;background-color']='#ffcc00';
templatecolors['#inside;background-color']='#c0c0b0';
templatecolors['#main-menu;background-color']='#c0c0b0';
templatecolors['#main-menu;color']='#af8060';
templatecolors['#main-menu a;background-color']='#c0c0b0';
templatecolors['#main-menu a;color']='#2f4860';
templatecolors['#main-menu a:hover;background-color']='';
templatecolors['#main-menu a:hover;color']='#2f4860';
templatecolors['#main-menu h3;color']='#ffffff';
templatecolors['#content;background-color']='#ffffff';
templatecolors['#content a;color']='#2f4860';
templatecolors['#content a:hover;color']='#2f4860';
templatecolors['#content th;background-color']='#ffffff';
templatecolors['#content h3;color']='#2f4860';
templatecolors['#content dt;color']='#2f4860';
templatecolors['#footer;background-color']='#ffffff';
templatecolors['#footer;color']='#ffffff';
templatecolors['.info_title;background-color']='#c0c0b0';
templatecolors['.info_title;color']='#ffffff';
window.templatecolors=templatecolors;
//document.getElementById('colorpicker').addEventListener('click',stylset,false);
//]]></script>

<script type="text/javascript">//<![CDATA[

function stylsel(i){
  window.i=i;
  document.getElementById('stylsel').style.backgroundColor=window.templatecolors[window.i];
  alert('updated original style');
}

function convertcolor(c){
  if(c.substr(0,1)=='r' || c.substr(0,1)=='R'){
    r=c.split(',');
    return'#'+rgb(r[0].replace(/[^0-9]/g, ''),r[1].replace(/[^0-9]/g, ''),r[2].replace(/[^0-9]/g, '')).toString(16);
  }
}

function stylset(){
  //alert(window.colorpickercolor);
  var sample=document.getElementById('colorsample');
  window.templatecolors[window.i]=document.getElementById('colorsample').style.backgroundColor;
  //alert('changed color in array');
  document.getElementById('stylsel').style.backgroundColor=window.templatecolors[window.i];

  var styled=document.styledform.styled;

  var font='12 '+(sample.style.fontFamily||'"Courier New"');
  var bcolor=(convertcolor(sample.style.backgroundColor)||'#01');
  //var tcolor=bgr(bcolor);
  styled.style.font=font;
  styled.style.backgroundColor=bcolor;
  //styled.style.color=bgr(tcolor);
  styled.innerHTML='css {\n\n\
font:'+font+';\n\
background-color:'+bcolor+';\n\
color:'+'??;\n\
\n}';

    //ajaxdiv('stylsel','plugin/styled/stylview.php');
  //document.getElementById('preview').src='plugin/styled/preview.htm';

  //alert('update new style');
}

function ajaxdiv(adiv,cmd){
  if (window.XMLHttpRequest){ var xmlhttp=new XMLHttpRequest(); }
  else{ var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
  xmlhttp.onreadystatechange=function(){
    if (xmlhttp.readyState==4 && xmlhttp.status==200){
      document.getElementById(adiv).innerHTML=xmlhttp.responseText; }}
  xmlhttp.open("GET",cmd,true);
  xmlhttp.send();
}
/*
/^\d+$/                 //All-digit
/^\s*[-+]?\d+\s*$/      //Unbroken Signed integer & spaces
/^\d{1,5}$/             //1 to 5 digits
/^\d+\.\d\d$/           //Money
/^\d+(\.\d{2})$/        //Money
/^\d{1,3}(,\d\d\d)*\.\d\d$/  //comma-separated money - 12,432.57

       // optional comma-separated money - 12,432.57 or 12432.57
/^\d{1,3}(,\d\d\d)*\.\d\d$|^\d+\.\d\d$/
*/
//]]>

</script>
</body></html>